package com.stlm2.dems.recharge.dao.impl;

import org.springframework.stereotype.Repository;

import com.stlm2.dems.recharge.entity.Recharge;
import com.stlm2.dems.recharge.dao.RechargeDao;
import com.stlm2.core.base.impl.BaseDaoImpl;

import java.util.List;

@Repository("rechargeDao")
public class RechargeDaoImpl extends BaseDaoImpl<Recharge> implements RechargeDao {

    @Override
    public Recharge getByCode(String code) {
        return selectOne("getByCode",code);
    }

    @Override
    public Recharge getByIdForUpdate(Integer id) {
        if(id <= 0)
            return null;

        return selectOne("getByIdForUpdate", id);
    }

    @Override
    public List<Recharge> getByUserId(Integer userid) {
        return  selectList("getByUserId",userid);
    }

    @Override
    public List<Recharge> getOverRechageByUserId(Integer userid) {
        return  selectList("getOverRechageByUserId",userid);
    }
}